import service from '@/utils/request';

const request = service.service

function Api() { }

// 逆地理编码
Api.prototype.ReverseGeocode = function (params) {
  return request({
    url: `http://api.tianditu.gov.cn/geocoder?postStr={'lon':${params.lon},'lat':${params.lat},'ver':1}&type=geocode&tk=${config.ak}`, method: 'POST', headers: {
      isToken: false
    },
  })
}

// 村范围线
Api.prototype.GetVillageRange = function (params) { return request({ url: `/peril/cun`, method: 'POST', params }) }

// 区范围线
Api.prototype.GetAreaRange = function (params) { return request({ url: `/peril/fwx`, method: 'POST', params }) }

// 隐患薄弱点
Api.prototype.GetWeakPoint = function (params) { return request({ url: `/peril/perilWeak`, method: 'POST', params }) }

// 一张图
Api.prototype.GetOneMap = function (params) { return request({ url: '/peril/aimap', method: 'post', params }) }

// 首页统计图  按数量统计
Api.prototype.AnalyseGetCount = function (params) { return request({ url: '/peril/selectTimeCount', method: 'post', params }) }

// 首页统计图 按程度统计
Api.prototype.AnalyseGetDegree = function (params) { return request({ url: '/peril/selectLevelCount', method: 'post', params }) }

// 首页统计图 按类型统计
Api.prototype.AnalyseGetType = function (params) { return request({ url: '/peril/selectHazardtypeCount', method: 'post', params }) }

// 首页统计图 按村统计
Api.prototype.AnalyseGetVillage = function (params) { return request({ url: '/peril/selectCount', method: 'post', params }) }

// 首页统计图 村列表
Api.prototype.AnalyseGetVillageList = function (params) { return request({ url: '/system/dept/list', method: 'post', params }) }

// 首页统计图 总数
Api.prototype.AnalyseGetTotal = function (params) { return request({ url: '/peril/selectCountAll', method: 'post', params }) }



export default new Api()